package com.minimalist.common.entity.lindi.vo.tradeapplication;

import cn.hutool.core.date.DatePattern;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.minimalist.common.entity.basic.vo.file.FileVO;
import com.minimalist.common.entity.lindi.vo.enterpriseaccount.LindiEnterpriseAccountVO;
import com.minimalist.common.entity.lindi.vo.tradeapplicationapprovefile.LindiTradeApplicationApproveFileVO;
import com.minimalist.common.entity.lindi.vo.tradeapplicationconfirmletter.LindiTradeApplicationConfirmLetterVO;
import com.minimalist.common.entity.lindi.vo.tradeapplicationcontract.LindiTradeApplicationContractVO;
import com.minimalist.common.entity.lindi.vo.tradeapplicationcredit.LindiTradeApplicationCreditVO;
import com.minimalist.common.entity.lindi.vo.tradeapplicationfile.LindiTradeApplicationFileVO;
import com.minimalist.common.entity.lindi.vo.tradeapplicationinvoice.LindiTradeApplicationInvoiceVO;
import com.minimalist.common.entity.lindi.vo.tradeapplicationoperator.LindiTradeApplicationOperatorVO;
import com.minimalist.common.entity.lindi.vo.tradeapplicationtemplateconfirmletter.LindiTradeApplicationTemplateConfirmLetterVO;
import com.minimalist.common.entity.lindi.vo.tradeapplicationtemplatecontract.LindiTradeApplicationTemplateContractVO;
import com.minimalist.common.utils.Add;
import com.minimalist.common.utils.Update;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects;

/**
 * 林地指标平台_交易指标申请实体
 *
 * @author 11987
 */
@Schema(name = "林地指标平台_交易指标申请实体")
public class LindiTradeApplicationVO implements Serializable{
    @Serial
    private static final long serialVersionUID = 1L;

    // 基础信息字段
    @NotNull(message = "交易指标申请ID不能为空", groups = {Update.class})
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "tradeApplicationId", description = "交易指标申请ID", type = "string")
    private Long tradeApplicationId;

    @NotNull(message = "企业用户ID不能为空", groups = {Update.class})
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "enterpriseAccountId", description = "企业用户ID", type = "string")
    private Long enterpriseAccountId;

    @Schema(name = "enterpriseAccount", description = "企业账户信息")
    private LindiEnterpriseAccountVO enterpriseAccount;

    @NotBlank(message = "项目名称不能为空", groups = {Add.class, Update.class})
    @Schema(name = "projectName", description = "项目名称", type = "string")
    private String projectName;

    @NotBlank(message = "项目地址不能为空", groups = {Add.class, Update.class})
    @Schema(name = "projectLocation", description = "项目地址", type = "string")
    private String projectLocation;

    @NotNull(message = "交易状态不能为空", groups = {Update.class})
    @Schema(name = "tradeStatus", description = "交易状态", type = "string")
    private Integer tradeStatus;

    @NotNull(message = "项目类型不能为空", groups = {Update.class})
    @Schema(name = "projectType", description = "项目类型", type = "string")
    private Integer projectType;

    // 扩展信息字段
    @Schema(name = "projectTypeName", description = "项目类型名称", type = "string")
    private String projectTypeName;

    @Schema(name = "tradeStatusName", description = "交易状态名称", type = "string")
    private String tradeStatusName;

    @Schema(name = "tradeCode", description = "交易指标编号", type = "string")
    private String tradeCode;

    @Schema(name = "tradeCodeType", description = "交易编号类型", type = "string")
    private String tradeCodeType;

    @Schema(name = "tradeCodeTypeName", description = "交易编号类型名称", type = "string")
    private String tradeCodeTypeName;

    @Schema(name = "reserveArea", description = "申请购买面积-市储备库指标(亩)", type = "string")
    private String reserveArea;

    @Schema(name = "publicForestArea", description = "申请购买面积-省级公益林(亩)", type = "string")
    private String publicForestArea;

    @Schema(name = "reserveAreaMoney", description = "市储备库金额", type = "number")
    private BigDecimal reserveAreaMoney;

    @Schema(name = "publicForestAreaMoney", description = "省级公益林金额", type = "number")
    private BigDecimal publicForestAreaMoney;

    @Schema(name = "totalArea", description = "总面积(亩)", type = "string")
    private String totalArea;

    @Schema(name = "applicationReason", description = "申请理由", type = "string")
    private String applicationReason;

    @Schema(name = "projectSituation", description = "情况简介（体现土地四至以及备案号/立项项目编码/文件批复等）", type = "string")
    private String projectSituation;

    @Schema(name = "redlineMapId", description = "红线图文件ID", type = "string")
    private Long redlineMapId;

    @Schema(name = "redlineMapFile", description = "红线图文件")
    private FileVO redlineMapFile;

    @Schema(name = "refuseReason", description = "拒绝原因", type = "string")
    private String refuseReason;

    @Schema(name = "money", description = "项目金额", type = "string")
    private String money;

    @Schema(name = "reason", description = "购买理由", type = "string")
    private String reason;

    @Schema(name = "applicationTime", description = "申请时间", type = "string")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private LocalDateTime applicationTime;

    @Schema(name = "otherFiles", description = "其他文件ID列表", type = "array")
    private List<Long> otherFiles;

    @Schema(name = "otherFilesVO", description = "其他文件列表")
    private List<FileVO> otherFilesVO;

    // 多租户字段
    @Schema(name = "tenantId", description = "租户ID", type = "string")
    private Long tenantId;

    @Schema(name = "tenantName", description = "租户名称", type = "string")
    private String tenantName;

    // 审计字段
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "createId", description = "创建人ID", type = "string")
    private Long createId;

    @Schema(name = "createName", description = "创建人姓名", type = "string")
    private String createName;

    @Schema(name = "createTime", description = "创建时间", type = "string")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private LocalDateTime createTime;

    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "updateId", description = "更新人ID", type = "string")
    private Long updateId;

    @Schema(name = "updateName", description = "更新人姓名", type = "string")
    private String updateName;

    @Schema(name = "updateTime", description = "更新时间", type = "string")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private LocalDateTime updateTime;

    // 关联的子对象列表
    @Schema(name = "tradeApplicationFileList", description = "交易申请文件列表")
    private List<LindiTradeApplicationFileVO> tradeApplicationFileList;

    @Schema(name = "tradeApplicationApproveFileList", description = "交易申请审批文件列表")
    private List<LindiTradeApplicationApproveFileVO> tradeApplicationApproveFileList;

    @Schema(name = "tradeApplicationContractList", description = "交易申请合同列表")
    private List<LindiTradeApplicationContractVO> tradeApplicationContractList;

    @Schema(name = "tradeApplicationInvoiceList", description = "交易申请发票列表")
    private List<LindiTradeApplicationInvoiceVO> tradeApplicationInvoiceList;

    @Schema(name = "tradeApplicationCreditList", description = "交易申请付款凭证列表")
    private List<LindiTradeApplicationCreditVO> tradeApplicationCreditList;

    @Schema(name = "tradeApplicationConfirmLetterList", description = "交易申请确认函列表")
    private List<LindiTradeApplicationConfirmLetterVO> tradeApplicationConfirmLetterList;

    @Schema(name = "tradeApplicationTemplateConfirmLetterList", description = "交易申请确认函模板列表")
    private List<LindiTradeApplicationTemplateConfirmLetterVO> tradeApplicationTemplateConfirmLetterList;

    @Schema(name = "tradeApplicationTemplateContractList", description = "交易申请合同模板列表")
    private List<LindiTradeApplicationTemplateContractVO> tradeApplicationTemplateContractList;

    @Schema(name = "tradeApplicationOperatorList", description = "交易申请操作记录列表")
    private List<LindiTradeApplicationOperatorVO> tradeApplicationOperatorList;

    public Long getTradeApplicationId(){
        return tradeApplicationId;
    }

    public void setTradeApplicationId(Long tradeApplicationId){
        this.tradeApplicationId = tradeApplicationId;
    }

    public Long getEnterpriseAccountId(){
        return enterpriseAccountId;
    }

    public void setEnterpriseAccountId(Long enterpriseAccountId){
        this.enterpriseAccountId = enterpriseAccountId;
    }

    public LindiEnterpriseAccountVO getEnterpriseAccount(){
        return enterpriseAccount;
    }

    public void setEnterpriseAccount(LindiEnterpriseAccountVO enterpriseAccount){
        this.enterpriseAccount = enterpriseAccount;
    }

    public String getProjectName(){
        return projectName;
    }

    public void setProjectName(String projectName){
        this.projectName = projectName;
    }

    public String getProjectLocation(){
        return projectLocation;
    }

    public void setProjectLocation(String projectLocation){
        this.projectLocation = projectLocation;
    }

    public Integer getTradeStatus(){
        return tradeStatus;
    }

    public void setTradeStatus(Integer tradeStatus){
        this.tradeStatus = tradeStatus;
    }

    public Integer getProjectType(){
        return projectType;
    }

    public void setProjectType(Integer projectType){
        this.projectType = projectType;
    }

    public String getProjectTypeName(){
        return projectTypeName;
    }

    public void setProjectTypeName(String projectTypeName){
        this.projectTypeName = projectTypeName;
    }

    public String getTradeStatusName(){
        return tradeStatusName;
    }

    public void setTradeStatusName(String tradeStatusName){
        this.tradeStatusName = tradeStatusName;
    }

    public String getTradeCode(){
        return tradeCode;
    }

    public void setTradeCode(String tradeCode){
        this.tradeCode = tradeCode;
    }

    public String getTradeCodeType(){
        return tradeCodeType;
    }

    public void setTradeCodeType(String tradeCodeType){
        this.tradeCodeType = tradeCodeType;
    }

    public String getTradeCodeTypeName(){
        return tradeCodeTypeName;
    }

    public void setTradeCodeTypeName(String tradeCodeTypeName){
        this.tradeCodeTypeName = tradeCodeTypeName;
    }

    public String getReserveArea(){
        return reserveArea;
    }

    public void setReserveArea(String reserveArea){
        this.reserveArea = reserveArea;
    }

    public String getPublicForestArea(){
        return publicForestArea;
    }

    public void setPublicForestArea(String publicForestArea){
        this.publicForestArea = publicForestArea;
    }

    public BigDecimal getReserveAreaMoney(){
        return reserveAreaMoney;
    }

    public void setReserveAreaMoney(BigDecimal reserveAreaMoney){
        this.reserveAreaMoney = reserveAreaMoney;
    }

    public BigDecimal getPublicForestAreaMoney(){
        return publicForestAreaMoney;
    }

    public void setPublicForestAreaMoney(BigDecimal publicForestAreaMoney){
        this.publicForestAreaMoney = publicForestAreaMoney;
    }

    public String getTotalArea(){
        return totalArea;
    }

    public void setTotalArea(String totalArea){
        this.totalArea = totalArea;
    }

    public String getApplicationReason(){
        return applicationReason;
    }

    public void setApplicationReason(String applicationReason){
        this.applicationReason = applicationReason;
    }

    public String getProjectSituation(){
        return projectSituation;
    }

    public void setProjectSituation(String projectSituation){
        this.projectSituation = projectSituation;
    }

    public Long getRedlineMapId(){
        return redlineMapId;
    }

    public void setRedlineMapId(Long redlineMapId){
        this.redlineMapId = redlineMapId;
    }

    public FileVO getRedlineMapFile(){
        return redlineMapFile;
    }

    public void setRedlineMapFile(FileVO redlineMapFile){
        this.redlineMapFile = redlineMapFile;
    }

    public String getRefuseReason(){
        return refuseReason;
    }

    public void setRefuseReason(String refuseReason){
        this.refuseReason = refuseReason;
    }

    public String getMoney(){
        return money;
    }

    public void setMoney(String money){
        this.money = money;
    }

    public String getReason(){
        return reason;
    }

    public void setReason(String reason){
        this.reason = reason;
    }

    public LocalDateTime getApplicationTime(){
        return applicationTime;
    }

    public void setApplicationTime(LocalDateTime applicationTime){
        this.applicationTime = applicationTime;
    }

    public List<Long> getOtherFiles(){
        return otherFiles;
    }

    public void setOtherFiles(List<Long> otherFiles){
        this.otherFiles = otherFiles;
    }

    public List<FileVO> getOtherFilesVO(){
        return otherFilesVO;
    }

    public void setOtherFilesVO(List<FileVO> otherFilesVO){
        this.otherFilesVO = otherFilesVO;
    }

    public Long getTenantId(){
        return tenantId;
    }

    public void setTenantId(Long tenantId){
        this.tenantId = tenantId;
    }

    public String getTenantName(){
        return tenantName;
    }

    public void setTenantName(String tenantName){
        this.tenantName = tenantName;
    }

    public Long getCreateId(){
        return createId;
    }

    public void setCreateId(Long createId){
        this.createId = createId;
    }

    public String getCreateName(){
        return createName;
    }

    public void setCreateName(String createName){
        this.createName = createName;
    }

    public LocalDateTime getCreateTime(){
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime){
        this.createTime = createTime;
    }

    public Long getUpdateId(){
        return updateId;
    }

    public void setUpdateId(Long updateId){
        this.updateId = updateId;
    }

    public String getUpdateName(){
        return updateName;
    }

    public void setUpdateName(String updateName){
        this.updateName = updateName;
    }

    public LocalDateTime getUpdateTime(){
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime){
        this.updateTime = updateTime;
    }

    public List<LindiTradeApplicationFileVO> getTradeApplicationFileList(){
        return tradeApplicationFileList;
    }

    public void setTradeApplicationFileList(List<LindiTradeApplicationFileVO> tradeApplicationFileList){
        this.tradeApplicationFileList = tradeApplicationFileList;
    }

    public List<LindiTradeApplicationApproveFileVO> getTradeApplicationApproveFileList(){
        return tradeApplicationApproveFileList;
    }

    public void setTradeApplicationApproveFileList(List<LindiTradeApplicationApproveFileVO> tradeApplicationApproveFileList){
        this.tradeApplicationApproveFileList = tradeApplicationApproveFileList;
    }

    public List<LindiTradeApplicationContractVO> getTradeApplicationContractList(){
        return tradeApplicationContractList;
    }

    public void setTradeApplicationContractList(List<LindiTradeApplicationContractVO> tradeApplicationContractList){
        this.tradeApplicationContractList = tradeApplicationContractList;
    }

    public List<LindiTradeApplicationInvoiceVO> getTradeApplicationInvoiceList(){
        return tradeApplicationInvoiceList;
    }

    public void setTradeApplicationInvoiceList(List<LindiTradeApplicationInvoiceVO> tradeApplicationInvoiceList){
        this.tradeApplicationInvoiceList = tradeApplicationInvoiceList;
    }

    public List<LindiTradeApplicationCreditVO> getTradeApplicationCreditList(){
        return tradeApplicationCreditList;
    }

    public void setTradeApplicationCreditList(List<LindiTradeApplicationCreditVO> tradeApplicationCreditList){
        this.tradeApplicationCreditList = tradeApplicationCreditList;
    }

    public List<LindiTradeApplicationConfirmLetterVO> getTradeApplicationConfirmLetterList(){
        return tradeApplicationConfirmLetterList;
    }

    public void setTradeApplicationConfirmLetterList(List<LindiTradeApplicationConfirmLetterVO> tradeApplicationConfirmLetterList){
        this.tradeApplicationConfirmLetterList = tradeApplicationConfirmLetterList;
    }

    public List<LindiTradeApplicationTemplateConfirmLetterVO> getTradeApplicationTemplateConfirmLetterList(){
        return tradeApplicationTemplateConfirmLetterList;
    }

    public void setTradeApplicationTemplateConfirmLetterList(List<LindiTradeApplicationTemplateConfirmLetterVO> tradeApplicationTemplateConfirmLetterList){
        this.tradeApplicationTemplateConfirmLetterList = tradeApplicationTemplateConfirmLetterList;
    }

    public List<LindiTradeApplicationTemplateContractVO> getTradeApplicationTemplateContractList(){
        return tradeApplicationTemplateContractList;
    }

    public void setTradeApplicationTemplateContractList(List<LindiTradeApplicationTemplateContractVO> tradeApplicationTemplateContractList){
        this.tradeApplicationTemplateContractList = tradeApplicationTemplateContractList;
    }

    public List<LindiTradeApplicationOperatorVO> getTradeApplicationOperatorList(){
        return tradeApplicationOperatorList;
    }

    public void setTradeApplicationOperatorList(List<LindiTradeApplicationOperatorVO> tradeApplicationOperatorList){
        this.tradeApplicationOperatorList = tradeApplicationOperatorList;
    }

    @Override
    public boolean equals(Object o){
        if (o == null || getClass() != o.getClass()){
            return false;
        }
        LindiTradeApplicationVO that = (LindiTradeApplicationVO) o;
        return Objects.equals(tradeApplicationId, that.tradeApplicationId)
                && Objects.equals(enterpriseAccountId, that.enterpriseAccountId)
                && Objects.equals(enterpriseAccount, that.enterpriseAccount)
                && Objects.equals(projectName, that.projectName)
                && Objects.equals(projectLocation, that.projectLocation)
                && Objects.equals(tradeStatus, that.tradeStatus)
                && Objects.equals(projectType, that.projectType)
                && Objects.equals(projectTypeName, that.projectTypeName)
                && Objects.equals(tradeStatusName, that.tradeStatusName)
                && Objects.equals(tradeCode, that.tradeCode)
                && Objects.equals(tradeCodeType, that.tradeCodeType)
                && Objects.equals(tradeCodeTypeName, that.tradeCodeTypeName)
                && Objects.equals(reserveArea, that.reserveArea)
                && Objects.equals(publicForestArea, that.publicForestArea)
                && Objects.equals(totalArea, that.totalArea)
                && Objects.equals(applicationReason, that.applicationReason)
                && Objects.equals(projectSituation, that.projectSituation)
                && Objects.equals(redlineMapId, that.redlineMapId)
                && Objects.equals(redlineMapFile, that.redlineMapFile)
                && Objects.equals(refuseReason, that.refuseReason)
                && Objects.equals(money, that.money)
                && Objects.equals(reason, that.reason)
                && Objects.equals(applicationTime, that.applicationTime)
                && Objects.equals(otherFiles, that.otherFiles)
                && Objects.equals(otherFilesVO, that.otherFilesVO)
                && Objects.equals(tenantId, that.tenantId)
                && Objects.equals(tenantName, that.tenantName)
                && Objects.equals(createId, that.createId)
                && Objects.equals(createName, that.createName)
                && Objects.equals(createTime, that.createTime)
                && Objects.equals(updateId, that.updateId)
                && Objects.equals(updateName, that.updateName)
                && Objects.equals(updateTime, that.updateTime)
                && Objects.equals(tradeApplicationFileList, that.tradeApplicationFileList)
                && Objects.equals(tradeApplicationApproveFileList, that.tradeApplicationApproveFileList)
                && Objects.equals(tradeApplicationContractList, that.tradeApplicationContractList)
                && Objects.equals(tradeApplicationInvoiceList, that.tradeApplicationInvoiceList)
                && Objects.equals(tradeApplicationCreditList, that.tradeApplicationCreditList)
                && Objects.equals(tradeApplicationConfirmLetterList, that.tradeApplicationConfirmLetterList)
                && Objects.equals(tradeApplicationTemplateConfirmLetterList, that.tradeApplicationTemplateConfirmLetterList)
                && Objects.equals(tradeApplicationTemplateContractList, that.tradeApplicationTemplateContractList)
                && Objects.equals(tradeApplicationOperatorList, that.tradeApplicationOperatorList);
    }

    @Override
    public int hashCode(){
        return Objects.hash(tradeApplicationId, enterpriseAccountId, enterpriseAccount, projectName, projectLocation, tradeStatus, projectType, projectTypeName, tradeStatusName, tradeCode, tradeCodeType, tradeCodeTypeName, reserveArea, publicForestArea, totalArea, applicationReason, projectSituation, redlineMapId, redlineMapFile, refuseReason, money, reason, applicationTime, otherFiles, otherFilesVO, tenantId, tenantName, createId, createName, createTime, updateId, updateName, updateTime, tradeApplicationFileList, tradeApplicationApproveFileList, tradeApplicationContractList, tradeApplicationInvoiceList, tradeApplicationCreditList, tradeApplicationConfirmLetterList, tradeApplicationTemplateConfirmLetterList, tradeApplicationTemplateContractList, tradeApplicationOperatorList);
    }

    @Override
    public String toString(){
        return "LindiTradeApplicationVO{" +
                "tradeApplicationId=" + tradeApplicationId +
                ", enterpriseAccountId=" + enterpriseAccountId +
                ", enterpriseAccount=" + enterpriseAccount +
                ", projectName='" + projectName + '\'' +
                ", projectLocation='" + projectLocation + '\'' +
                ", tradeStatus=" + tradeStatus +
                ", projectType=" + projectType +
                ", projectTypeName='" + projectTypeName + '\'' +
                ", tradeStatusName='" + tradeStatusName + '\'' +
                ", tradeCode='" + tradeCode + '\'' +
                ", tradeCodeType='" + tradeCodeType + '\'' +
                ", tradeCodeTypeName='" + tradeCodeTypeName + '\'' +
                ", reserveArea='" + reserveArea + '\'' +
                ", publicForestArea='" + publicForestArea + '\'' +
                ", totalArea='" + totalArea + '\'' +
                ", applicationReason='" + applicationReason + '\'' +
                ", projectSituation='" + projectSituation + '\'' +
                ", redlineMapId=" + redlineMapId +
                ", redlineMapFile=" + redlineMapFile +
                ", refuseReason='" + refuseReason + '\'' +
                ", money='" + money + '\'' +
                ", reason='" + reason + '\'' +
                ", applicationTime=" + applicationTime +
                ", otherFiles=" + otherFiles +
                ", otherFilesVO=" + otherFilesVO +
                ", tenantId='" + tenantId + '\'' +
                ", tenantName='" + tenantName + '\'' +
                ", createId='" + createId + '\'' +
                ", createName='" + createName + '\'' +
                ", createTime=" + createTime +
                ", updateId='" + updateId + '\'' +
                ", updateName='" + updateName + '\'' +
                ", updateTime=" + updateTime +
                ", tradeApplicationFileList=" + tradeApplicationFileList +
                ", tradeApplicationApproveFileList=" + tradeApplicationApproveFileList +
                ", tradeApplicationContractList=" + tradeApplicationContractList +
                ", tradeApplicationInvoiceList=" + tradeApplicationInvoiceList +
                ", tradeApplicationCreditList=" + tradeApplicationCreditList +
                ", tradeApplicationConfirmLetterList=" + tradeApplicationConfirmLetterList +
                ", tradeApplicationTemplateConfirmLetterList=" + tradeApplicationTemplateConfirmLetterList +
                ", tradeApplicationTemplateContractList=" + tradeApplicationTemplateContractList +
                ", tradeApplicationOperatorList=" + tradeApplicationOperatorList +
                '}';
    }
}
